Skip to content

Comments

Check that funder covers the fee spike buffer multiple after a splice#4433

Open
tankyleo wants to merge 2 commits intolightningdevkit:mainfrom
tankyleo:2026-02-splice-assertions
Open

Check that funder covers the fee spike buffer multiple after a splice#4433
tankyleo wants to merge 2 commits intolightningdevkit:mainfrom
tankyleo:2026-02-splice-assertions

Conversation

@tankyleo
Copy link
Contributor

    Assert that a balance under a post-splice reserve did not budge

    Notably, if a party splices funds into the channel, their new balance
    must be above the new reserve.

and

    Check that funder covers the fee spike buffer multiple after a splice

    We do this for HTLCs, so we should also do this for splices. This
    applies to `only_static_remote_key` channels alone.

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Feb 23, 2026

👋 Thanks for assigning @wpaulino as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tankyleo tankyleo requested a review from wpaulino February 23, 2026 07:02
@tankyleo tankyleo force-pushed the 2026-02-splice-assertions branch 2 times, most recently from 9035906 to 1959d52 Compare February 23, 2026 07:48
@tankyleo tankyleo self-assigned this Feb 23, 2026
@tankyleo tankyleo moved this to Goal: Merge in Weekly Goals Feb 23, 2026
@tankyleo tankyleo added this to the 0.3 milestone Feb 23, 2026
@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.90%. Comparing base (62c7575) to head (1959d52).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4433      +/-   ##
==========================================
+ Coverage   85.87%   85.90%   +0.02%     
==========================================
  Files         157      159       +2     
  Lines      103769   104315     +546     
  Branches   103769   104315     +546     
==========================================
+ Hits        89115    89613     +498     
- Misses      12158    12203      +45     
- Partials     2496     2499       +3     
Flag Coverage Δ
tests 85.90% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

1
};

let feerate_per_kw = if !funding.get_channel_type().supports_anchors_zero_fee_htlc_tx() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be funding.get_channel_type() == ChannelTypeFeatures::only_static_remote_key?

// 4) Try again with the additional satoshi removed from the splice-out message, and check that it passes
// validation on the receiver's side.

let (preimage_1_to_0_d, node_1_real_splice_out) = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not DRY this up with the presage_0_to_1_d block below?

@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

Notably, if a party splices funds into the channel, their new balance
must be above the new reserve.
@tankyleo tankyleo force-pushed the 2026-02-splice-assertions branch 2 times, most recently from 35e63f7 to c1b8f14 Compare February 25, 2026 03:42
We do this for HTLCs, so we should also do this for splices. This
applies to `only_static_remote_key` channels alone.
@tankyleo tankyleo force-pushed the 2026-02-splice-assertions branch from c1b8f14 to 260dcc5 Compare February 25, 2026 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Goal: Merge

Development

Successfully merging this pull request may close these issues.

3 participants